home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
macros
/
latex209
/
contrib
/
tesla
/
eng-form.sty
< prev
next >
Wrap
Text File
|
1994-07-26
|
4KB
|
109 lines
%
% eng-form.sty
%
% This is part of the TeSLa package that is the subject of the paper
% entitled "An Example Special Purpose Input Language to LaTeX" that
% was (will be) presented to the TUG94 conference in Santa Barabara.
%
% Please see tesla.sty for more details.
% ======================================
%
%
% Customization Required for [tvar.
% =================================
%
% The English form is the second "form" used by TeSLa. That is, the
% tabular form (the first "form") is ignored when the English form is
% used. This is implemented with the \xform command, whose arguments
% are:
% #1 - The tabular form
% #2 - The English form; IGNORED in this style
%
% See the "The [tvar command" subsection of "The Implementation" section
% in the paper for more details.
%
\gdef\xform #1#2{#2}
%
% Customization Required for [tgroup.
% ===================================
%
% The \xbegin command defines the TeX formatting to be inserted at the
% begining of a group of rules. Its arguments are:
% #1 - TeX command to be used for the \trule command
% #2 - the number of conditions in each rule
% #3 - the number of columns in the table (#2 + 1)
% #4 - the width of each column
% #5 - the title for the group of rules
% In this English form, we start a new LaTeX subsection.
%
% The \sep command defines the TeX formatting to be inserted to add
% some extra separation between subgroups of a group of rules. In
% this English form, it does nothing.
%
% The \xend command defines the TeX formatting to be inserted at the
% end of a group of rules. In this English form, it does nothing.
%
% See the "The [tgroup command" subsection of "The Implementation" section
% in the paper for more details.
%
\gdef\xbegin#1#2#3#4#5{
\gdef\trule{\csname #1\endcsname}
\subsection*{#5 Rules}
}
\gdef\xsep{}
\gdef\xend{}
%
% Customization Required for [trule.
% ==================================
%
% The \xpre command defines the TeX formatting to be inserted for an
% empty KB-condition. In this English form, it does nothing.
%
% The \xif command defines the TeX formatting to be inserted for the
% first non-empty KB-condition. It takes one argument:
% #1 - The first non-empty KB-condition
% In this English form, it inserts an "If" and columns) and the
% KB-condition.
%
% The \xand command defines the TeX formatting to be inserted for the
% rest of the KB-conditions. It takes one argument:
% #1 - The KB-condition
% In this English form, it insert an "and" and the KB-condition, if it
% is non-empty.
%
% The \xthen command defines the TeX formatting to be inserted for the
% KB-consequence. It takes one argument:
% #1 - The KB-consequence
% In this English form, it inserts a "then", the KB-consequence and a
% period (.).
%
% See the "The [trule command" subsection of "The Implementation" section
% in the paper for more details.
%
\gdef\xpre{}
\gdef\xif#1{\par {\bf If} \xrel #1}
\gdef\xand#1{\ifx#1\empty\else{\bf and} \xrel #1 \fi }
\gdef\xthen#1{{\bf then} \xrel #1.}
%
% Customization Required for [ttext and [trem.
% ============================================
%
% The \xtext command defines the TeX formatting to be inserted for
% arbitrary explanatory text. It takes one argument:
% #1 - The explantory text
% In this English form, it prints the text---in italics---as a separate
% paragraph.
%
% The \xrem command defines the TeX formatting to be inserted for
% extra explanatory text into the tabular form. It takes one argument:
% #1 - The extra explantory text
% In this English form, it does nothing.
%
\gdef\xtext#1{\par{\em #1}}
\gdef\xrem#1{}